<#import "/ftl/mainAdmin.ftl" as page>

<@page.mainTemplate styleSheet="commanageCss" jsFile="companyeditJs" current="公司信息">
  	<div class="page-content">
  		<!-- BEGIN PAGE HEAD-->
        <div class="page-head">
            <!-- BEGIN PAGE TITLE -->
            <div class="page-title">
                <h1><#if mCompanyVO.id == ''>创建公司<#else>修改公司</#if>
                    <small><#if mCompanyVO.id == ''>新增公司信息<#else>修改公司信息</#if></small>
                </h1>
            </div>
            <!-- END PAGE TITLE -->
        </div>
        <!-- END PAGE HEAD-->
        <!-- BEGIN PAGE BREADCRUMB -->
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <a href="${context}/base/index_ftl">首页</a>
                <i class="fa fa-circle"></i>
            </li>
            <li>
               <span class="active">公司管理</span>
                <i class="fa fa-circle"></i>
            </li>
            <li>
                <span class="active"><#if mCompanyVO.id == ''>创建公司<#else>修改公司</#if></span>
            </li>
        </ul>
        <!-- END PAGE BREADCRUMB -->
        <!-- BEGIN PAGE BASE CONTENT -->
        <div class="row">
            <div class="portlet light bordered">
                <div class="portlet-body form edit-form">
                    <!-- BEGIN FORM-->
                    <form action="#" id="createForm" class="createform">
                        <div class="form-body">
                        	<div class="alert alert-danger display-hide">
			                    <button class="close" data-close="alert"></button> 表单含有错误. 请检查. 
			                </div>
			                <div class="alert alert-success display-hide">
			                    <button class="close" data-close="alert"></button> 表单验证通过! 
			                </div>
                            <h4 class="form-section">公司基本信息</h4>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                    	
                                        <div class="input-group">
                                            <label class="input-group-addon">公司编码</label>
                                            <input type="hidden" value="${mCompanyVO.id}" name="id"  />
                                            <div class="input-group-content">
                                                <input type="text" id="company_code" name="company_code" class="form-control" placeholder="公司编码" readonly="readonly" value="${mCompanyVO.company_code}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">公司名称</label>
                                            <div class="input-group-content">
                                                <input type="text" id="company_name" name="company_name" class="form-control" placeholder="★公司名称" value='${mCompanyVO.company_name}' />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">公司地址</label>
                                            <div class="input-group-content">
                                                <input type="text" id="company_address" name="company_address" class="form-control" placeholder="★公司地址"  value="${mCompanyVO.company_address}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">建立日期</label>
                                            <div class="input-group-content">
                                                <div class="input-group">
                                                    <input type="text" id="company_create_time" name="company_create_time" class="form-control" readonly="readonly" placeholder="★建立日期" value="${mCompanyVO.dateToString(mCompanyVO.company_create_time)}">
                                                    <span class="input-group-btn">
                                                        <button class="btn default" type="button">
                                                            <i class="fa fa-calendar"></i>
                                                        </button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">邮政编码</label>
                                            <div class="input-group-content">
                                                <input type="text" id="postal_code" name="postal_code" class="form-control" placeholder="邮政编码" value="${mCompanyVO.postal_code}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">Email</label>
                                            <div class="input-group-content">
                                                <input type="text" id="email" name="email" class="form-control" placeholder="Example@gmail.com" value="${mCompanyVO.email}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">联系人</label>
                                            <div class="input-group-content">
                                                <input type="text" id="contacts" name="contacts"  class="form-control" placeholder="★联系人" value="${mCompanyVO.contacts}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">办公电话</label>
                                            <div class="input-group-content">
                                                <input type="text" id="office_tel" name="office_tel" class="form-control" placeholder="★办公电话" value="${mCompanyVO.office_tel}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">移动电话</label>
                                            <div class="input-group-content">
                                                <input type="text" id="telephone" name="telephone" class="form-control" placeholder="★移动电话" value="${mCompanyVO.telephone}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">状态</label>
                                            <div class="input-group-content">
                                                <select name="status" class="form-control input-inline">
                                                    <option value="">请选择</option>
                                                    <option value="DATA_AVAILABLE" <#if mCompanyVO.id== ""||mCompanyVO.status == "DATA_AVAILABLE">selected="selected"</#if>>启用</option>
                                                    <option value="DATA_LOCKING" <#if mCompanyVO.status == "DATA_LOCKING">selected="selected"</#if>>停用</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">客户属性</label>
                                            <div class="input-group-content">
                                                <select name="company_type" class="form-control input-inline">
						                            <option value="">★请选择</option>
						                             <option value="channel" <#if mCompanyVO.company_type == "channel">selected="selected"</#if>>渠道</option>
						                             <option value="channelConsumer" <#if mCompanyVO.company_type == "channelConsumer">selected="selected"</#if>>渠道客户</option>
						                             <option value="directConsumer" <#if mCompanyVO.company_type == "directConsumer">selected="selected"</#if>>直销客户</option>
						                        </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">所属渠道</label>
                                            <div class="input-group-content">
                                                <select class="form-control input-inline" name="channel_id" >
                                                <option value="${mCompanyVO.channel_id}">${mCompanyVO.channel_name}</option>
                              					</select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">备注</label>
                                            <div class="input-group-content">
                                                <input type="text" id="company_remark" name="company_remark" class="form-control" placeholder="备注" value="${mCompanyVO.company_remark}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <h4 class="form-section">公司资质信息</h4>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">营业执照</label>
                                            <div class="input-group-content">
                                                <input type="text" id="license" name="license" class="form-control" placeholder="★营业执照"   value="${mCompanyVO.license}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">组织机构</label>
                                            <div class="input-group-content">
                                                 <input type="text" id="org_code" name="org_code" class="form-control" placeholder="★组织代码"   value="${mCompanyVO.org_code}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">法人名称</label>
                                            <div class="input-group-content">
                                                <input type="text" id="legal_person" name="legal_person" class="form-control" placeholder="★法人名称"   value="${mCompanyVO.legal_person}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">证件类型</label>
                                            <div class="input-group-content">
                                                <select name="papers_type" class="form-control input-inline">
                                                    <option value="">★请选择</option>
                                                     <option value="IDENTITYCARD" <#if mCompanyVO.papers_type == "IDENTITYCARD">selected="selected"</#if>>身份证</option>
                                                    <option value="SOLDIERCARD" <#if mCompanyVO.papers_type == "SOLDIERCARD">selected="selected"</#if>>士兵证</option>
                                                    <option value="OFFICER" <#if mCompanyVO.papers_type == "OFFICER">selected="selected"</#if>>军官证</option>
                                                     <option value="POLICE" <#if mCompanyVO.papers_type == "POLICE">selected="selected"</#if>>警察证</option>
                                                    <option value="HOUSEHOLD" <#if mCompanyVO.papers_type == "HOUSEHOLD">selected="selected"</#if>>户口本</option>
                                                    <option value="PASSPORT" <#if mCompanyVO.papers_type == "PASSPORT">selected="selected"</#if>>护照</option>
                                                	<option value="TEMPORARY" <#if mCompanyVO.papers_type == "TEMPORARY">selected="selected"</#if>>临时证件</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">证件号码</label>
                                            <div class="input-group-content">
                                                <input type="text" id="papers_num" name="papers_num" class="form-control" placeholder="★证件号码" value="${mCompanyVO.papers_num}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                
                                <!--/span-->
                            </div>
                             <h4 class="form-section">公司开户信息</h3>
                             <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <div class="input-group">
                                                <label class="input-group-addon">开户渠道</label>
                                                <div class="input-group-content">
                                                	<select class="form-control input-inline" id="channel_type" name="channel_type" >
					                                    <#if userBankMap != null>
	                                                        <option value="${userBankMap.channel_type}" checked="checked" >${userBankMap.channel_type_name} </option>
	                                                	</#if>	
	                                                	 <#if userBankMap == null>
	                                                	  <#if userBankMap.channel_type == null>
	                                                	  	<option value="">★请选择</option>
					                                    	<#list type_list as type>
					                                    		<option value="${type.config_value}">${type.config_desc}</option>
										                    </#list>
										                     </#if>
										                  </#if>				                                    
					                                </select> 
                                            	</div>
                                            </div>
                                        </div>
                                    </div>
                            
                           </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户人名称</label>
                                            <div class="input-group-content">
                                            	<input type="text" id="bank_consumer_name" readonly name="bank_consumer_name" class="form-control" placeholder="★开户人名称(同企业名称)"  value="<#if userBankMap!=null>${userBankMap.bank_consumer_name}</#if>">
                                                
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户账号</label>
                                            <div class="input-group-content">
                                                <input type="text" id="card_num" name="card_num" class="form-control" placeholder="★开户帐号" value="<#if userBankMap!=null>${userBankMap.card_num}</#if>">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户行名称</label>
                                            <div class="input-group-content">
                                                <input name="cls_bank_name" id="cls_bank_name" type="hidden" value="<#if userBankMap!=null>${userBankMap.cls_bank_name}</#if>"  data-code='<#if userBankMap!=null>${userBankMap.cls_bank_code}</#if>' />
                                                <select name="cls_bank_code" id="cls_bank_code" class="form-control input-inline">
	                                               <#if userBankMap != null>
	                                                    <#if userBankMap.clsBankName != "">
	                                                        <option value="${userBankMap.cls_bank_code}" checked="checked" >${userBankMap.cls_bank_name} </option>
	                                                     </#if>
	                                                </#if>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户支行省市</label>
                                            <div class="input-group-content">
                                                <div class="col-md-6 plr0">
                                                    <input name="province_name" id="province_name" type="hidden"  value="<#if userBankMap!=null>${userBankMap.province_name}</#if>" data-code="<#if userBankMap!=null>${userBankMap.province_code}</#if>"/>
                                                    <select name="province_id" id="province_id" class="form-control input-inline">
                                                   
                                                    </select>
                                                </div>
                                                <div class="col-md-6 plr0">
                                                    <input name="city_name" id="city_name" type="hidden" value="<#if userBankMap!=null>${userBankMap.city_name}</#if>"  data-code="<#if userBankMap!=null>${userBankMap.city_id}</#if>"/>
                                                    <select name="city_id" id="city_id" class="form-control input-inline">
                                                   <#if userBankMap != null>
                                                    <#if userBankMap.city_id != "">
                                                        <option value="${userBankMap.city_id}"  checked="checked">${userBankMap.city_name} </option>
                                                     </#if>
                                                    </#if>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                            </div>
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">开户支行名称</label>
                                            <div class="input-group-content">
                                                <input name="bank_name" id="bank_name" type="hidden" value="<#if userBankMap!=null>${userBankMap.bank_name}</#if>" data-code="<#if userBankMap!=null>${userBankMap.bank_id}</#if>" />
                                                <select name="bank_id" id="bank_id" class="form-control input-inline">
                                                <#if userBankMap != null>
                                                        <option value="${userBankMap.bank_id}" checked="checked" >${userBankMap.bank_name} </option>
                                                </#if>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">账户性质</label>
                                            <div class="input-group-content">
                                                <input type="text" id="accountType" name="accountType" class="form-control" placeholder="★账户性质" value="企业" readonly="readonly">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                 <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">企业客户号</label>
                                            <div class="input-group-content">
                                                <input type="text" id="remark" name="remark" class="form-control" placeholder="企业客户号" value="<#if userBankMap!=null>${userBankMap.remark}</#if>">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!--/span-->
                                <div class="col-md-6">
                                         <div class="form-group">
                                           		<div class="input-group">
                                                  	<label class="input-group-addon">子账户</label>
                                                  	<div class="input-group-content">
                                                    	<input type="text" id="bank_account_no" class="form-control"  name="bank.accountNo" placeholder="开通子账户后显示账号信息" value="${bank_account_no}" disabled>
                                                	</div>
                                                </div>
                                          </div>
                                    </div>
                            </div>
                             <div class="row">
                                 <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">交易会员代码</label>
                                            <div class="input-group-content">
                                                <input type="text" id="tradeMemCode" name="tradeMemCode" readonly class="form-control" placeholder="交易会员代码" value="${tradeMemCode}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <label class="input-group-addon">摊位号</label>
                                            <div class="input-group-content">
                                                <input type="text" id="account_no" name="account_no" readonly class="form-control" placeholder="交易会员代码" value="${account_no}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div>
		                           	        <#if userBankMap.bank_info.status ?? >
		                           	        	<#if userBankMap.bank_info.status=='2' >
		                           	       		 支行信息已经失效，请及时更换
		                           	       		 </#if>
		                           	        </#if>
		                           	</div>
                        <div class="form-actions top">
                            <div class="row">
                                <button type="submit" id="btnSubmit" class="btn green">保存</button>
                                <a href="${context}/company/search_view_company" class="btn default">返回</a>
                            </div>
                        </div>
                    </form>
                    <!-- END FORM-->
                </div>
            </div>
        </div>
        <!-- END PAGE BASE CONTENT -->
    </div>
</@page.mainTemplate>